import { ComponentMetadata, Snippet } from '@alilc/lowcode-types';

const EmployeeManagementRightMeta: ComponentMetadata = {
  componentName: 'EmployeeManagementRight',
  title: '员工管理右侧',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  group: '员工管理',
  category: '数据展示',
  priority: 0,
  npm: {
    package: 'hzdz-charts',
    version: '0.1.0',
    exportName: 'EmployeeManagementRight',
    main: 'src/index.tsx',
    destructuring: true,
    subName: '',
  },
  configure: {
    props: [
      {
        title: '定位管理组件配置',
        display: 'block',
        type: 'group',
        items: [
          {
            name: 'positioningManagement.title',
            title: '定位管理标题',
            setter: 'StringSetter',
            defaultValue: '定位管理',
          },
          {
            name: 'positioningManagement.englishTitle',
            title: '定位管理英文标题',
            setter: 'StringSetter',
            defaultValue: 'Positioning management',
          },
          {
            name: 'positioningManagement.positioningRecords',
            title: '定位记录',
            setter: {
              componentName: 'ArraySetter',
              props: {
                itemSetter: {
                  componentName: 'ObjectSetter',
                  props: {
                    config: {
                      items: [
                        {
                          name: 'key',
                          title: '唯一标识',
                          setter: 'StringSetter',
                        },
                        {
                          name: 'employee',
                          title: '员工',
                          setter: 'StringSetter',
                        },
                        {
                          name: 'location',
                          title: '位置',
                          setter: 'StringSetter',
                        },
                        {
                          name: 'time',
                          title: '时间',
                          setter: 'StringSetter',
                        },
                        {
                          name: 'callInfo',
                          title: '呼叫信息',
                          setter: 'StringSetter',
                        },
                      ],
                    },
                  },
                },
              },
            },
            defaultValue: [
              {
                key: '1',
                employee: '员工1',
                location: '1F大厅',
                time: '14:39',
                callInfo: '意外事故',
              },
              {
                key: '2',
                employee: '员工2',
                location: '1F大厅',
                time: '14:39',
                callInfo: '意外事故',
              },
            ],
          },
        ],
      },
      {
        title: '任务追踪组件配置',
        display: 'block',
        type: 'group',
        items: [
          {
            name: 'taskTracking.title',
            title: '任务追踪标题',
            setter: 'StringSetter',
            defaultValue: '任务追踪',
          },
          {
            name: 'taskTracking.englishTitle',
            title: '任务追踪英文标题',
            setter: 'StringSetter',
            defaultValue: 'Task Tracking',
          },
          {
            name: 'taskTracking.taskStatistics',
            title: '任务统计',
            setter: {
              componentName: 'ObjectSetter',
              props: {
                config: {
                  items: [
                    {
                      name: 'totalTasks',
                      title: '任务总数',
                      setter: 'NumberSetter',
                    },
                    {
                      name: 'completedTasks',
                      title: '已完成任务',
                      setter: 'NumberSetter',
                    },
                    {
                      name: 'completionRate',
                      title: '完成率',
                      setter: 'StringSetter',
                    },
                  ],
                },
              },
            },
            defaultValue: {
              totalTasks: 278,
              completedTasks: 78,
              completionRate: '30%',
            },
          },
          {
            name: 'taskTracking.taskRecords',
            title: '任务记录',
            setter: {
              componentName: 'ArraySetter',
              props: {
                itemSetter: {
                  componentName: 'ObjectSetter',
                  props: {
                    config: {
                      items: [
                        {
                          name: 'key',
                          title: '唯一标识',
                          setter: 'StringSetter',
                        },
                        {
                          name: 'taskName',
                          title: '任务名称',
                          setter: 'StringSetter',
                        },
                        {
                          name: 'assignee',
                          title: '负责人',
                          setter: 'StringSetter',
                        },
                        {
                          name: 'status',
                          title: '状态',
                          setter: 'StringSetter',
                        },
                        {
                          name: 'priority',
                          title: '优先级',
                          setter: 'StringSetter',
                        },
                        {
                          name: 'deadline',
                          title: '截止时间',
                          setter: 'StringSetter',
                        },
                      ],
                    },
                  },
                },
              },
            },
            defaultValue: [
              {
                key: '1',
                taskName: '安全检查',
                assignee: '张三',
                status: '进行中',
                priority: '高',
                deadline: '2025-01-15',
              },
              {
                key: '2',
                taskName: '设备维护',
                assignee: '李四',
                status: '已完成',
                priority: '中',
                deadline: '2025-01-10',
              },
            ],
          },
        ],
      },
    ],
  },
  snippets: [
    {
      title: '员工管理右侧',
      screenshot: '',
      schema: {
        componentName: 'EmployeeManagementRight',
        props: {
          positioningManagement: {
            title: '定位管理',
            englishTitle: 'Positioning management',
            positioningRecords: [
              {
                key: '1',
                employee: '员工1',
                location: '1F大厅',
                time: '14:39',
                callInfo: '意外事故',
              },
              {
                key: '2',
                employee: '员工2',
                location: '1F大厅',
                time: '14:39',
                callInfo: '意外事故',
              },
            ],
          },
          taskTracking: {
            title: '任务追踪',
            englishTitle: 'Task Tracking',
            taskStatistics: {
              totalTasks: 278,
              completedTasks: 78,
              completionRate: '30%',
            },
            taskRecords: [
              {
                key: '1',
                taskName: '安全检查',
                assignee: '张三',
                status: '进行中',
                priority: '高',
                deadline: '2025-01-15',
              },
              {
                key: '2',
                taskName: '设备维护',
                assignee: '李四',
                status: '已完成',
                priority: '中',
                deadline: '2025-01-10',
              },
            ],
          },
        },
      },
    },
  ],
};

export default EmployeeManagementRightMeta;
